package com.hex.ds.hdrs.app.converter;

import com.hex.ds.hdrs.app.dto.AppAgentRelationDto;
import com.hex.ds.hdrs.app.po.AppAgentRelationPo;
import com.hex.ds.hdrs.common.utils.HdrsDateUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @Package com.hex.ds.hdrs.app.converter
 * @ClassName IAppAgentConverter
 * @Description 应用与节点关联业务转换器
 * @Author yu liuyang
 * @Date 2023/4/18 14:11
 * @Version v1.0
 **/
@Mapper(componentModel = "spring", imports = {HdrsDateUtil.class})
public interface IAppAgentRelationConverter {

    /**
     * @Method toAppAgentRelation <br>
     * @Param [appAgentRelationDto] <br>
     * @Return com.hex.ds.hdrs.app.po.AppAgentRelation <br>
     * @Description 将AppAgentRelationDto转换成AppAgentRelation <br>
     * @Author yu liuyang <br>
     * @Date 2023/4/18 14:12 <br>
     * @Version V1.0 <br>
     */
    @Mapping(target = "upTs", expression = "java(HdrsDateUtil.getCurrentTime())")
    @Mapping(target = "appCode", source = "appCode")
    AppAgentRelationPo toAppAgentRelation(AppAgentRelationDto appAgentRelationDto, String appCode);

    List<AppAgentRelationDto> toAppAgentRelationDtos(List<AppAgentRelationPo> appAgentRelationPos);
}
